package com.yun.config;

import com.yun.pojo.*;
import com.yun.util.Createtable;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.sql.SQLException;

@Component
public class inti {

    //@PostConstruct
    public void st(){

        try {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            Createtable.createTableUtils(new User(),"user");
            System.out.println("用户表创建成功");
            Createtable.createTableUtils(new Schedule(),"schedule");
            System.out.println("计划表创建成功");
            Createtable.createTableUtils(new Pet(),"pet");
            System.out.println("宠物表创建成功");
            Createtable.createTableUtils(new Message(),"message");
            System.out.println("信息表创建成功");
            Createtable.createTableUtils(new Medical(),"medical");
            System.out.println("治疗表创建成功");
            Createtable.createTableUtils(new Evaluate(),"evaluate");
            System.out.println("评价表创建成功");
            Createtable.createTableUtils(new Director(),"director");
            System.out.println("操作表创建成功");

        } catch (SQLException throwables) {
            throwables.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
